package com.cvte.shop.entity;


import java.io.Serializable;

import com.cvte.shop.entity.dto.FieldDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

import static org.apache.ibatis.type.JdbcType.*;

import tk.mybatis.mapper.annotation.ColumnType;
import com.cvte.csb.validator.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 查看字段
 *
 * @author inv
 * @since 2020-08-04
 */
@Table(name = "UNIVERSAL_RESULT_FIELDS")
@ApiModel(description = "查看字段")
@Data
@EqualsAndHashCode
public class UniversalResultFields extends BaseEntity {

    private static final long serialVersionUID = 1L;

    public UniversalResultFields(FieldDTO fieldDTO){
        this.fieldDesc = fieldDTO.getDescription();
        this.fieldName = fieldDTO.getFieldName();
        this.fieldType = fieldDTO.getFieldType();
        this.seq = fieldDTO.getSeq();
    }

    public UniversalResultFields(){}

    /**
     * 字段主键
     */
    @Column(name = "FIELD_ID")
    @ApiModelProperty(value = "字段主键")
    private String fieldId;
    /**
     * 字段名
     */
    @Column(name = "FIELD_NAME")
    @ApiModelProperty(value = "字段名")
    private String fieldName;
    /**
     * 字段类型
     */
    @Column(name = "FIELD_TYPE")
    @ApiModelProperty(value = "字段类型")
    private String fieldType;
    /**
     * 字段描述
     */
    @Column(name = "FIELD_DESC")
    @ApiModelProperty(value = "字段描述")
    private String fieldDesc;
    /**
     * 表的id
     */
    @Column(name = "TABLE_ID")
    @ApiModelProperty(value = "表的id")
    private String tableId;
    /**
     * 视图的id
     */
    @Column(name = "VIEW_ID")
    @ApiModelProperty(value = "视图的id")
    private String viewId;
    /**
     * 字段状态：0未启用，1已启用
     */
    @Column(name = "FIELD_STATUS")
    @ApiModelProperty(value = "字段状态：0未启用，1已启用")
    private Integer fieldStatus;
    /**
     * 字段状态：0未启用，1已启用
     */
    @Column(name = "SEQ")
    @ApiModelProperty(value = "序号")
    private Integer seq;

}
